import java.util.Scanner;

public class ZYTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入英文句子：");
        String s = sc.nextLine();

        // 临时存储单词
        String[] tempWords = new String[100]; // 假设最多100个单词
        int wordCount = 0;
        String currentWord = "";

        // 遍历每个字符
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i); // 获取第i个字符

            // 判断是否是字母
            if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
                currentWord += c; // 字母加到当前单词
            } else {
                // 不是字母，结束当前单词
                if (!currentWord.equals("")) {
                    tempWords[wordCount] = currentWord;
                    wordCount++;
                    currentWord = "";
                }
            }
        }

        // 处理最后一个单词
        if (!currentWord.equals("")) {
            tempWords[wordCount] = currentWord;
            wordCount++;
        }

        // 创建最终数组
        String[] words = new String[wordCount];
        for (int i = 0; i < wordCount; i++) {
            words[i] = tempWords[i];
        }

        // 打印结果
        System.out.println("提取的单词：");
        for (int i = 0; i < words.length; i++) {
            System.out.println(words[i]);
        }
    }
}
